const query = require('../models');

module.exports = {
  get: function (req, res) {
    const sql = `SELECT class_id classId,class_name className FROM classes`;
    query(sql, null)
      .then(function (result) {
        res.json({
          code: '200',
          msg: '操作成功',
          data: result
        });
      })
      .catch(function (err) {
        res.json({
          code: '1002',
          msg: '操作失败',
          err
        });
      });
  },
  del: function (req, res) { },
  add: function (req, res) { },
  edit: function (req, res) { },
  getById: function (req, res) { },
}